<?php

namespace app\nideshop\validate;

use think\Validate;

class OrderValidate extends Validate
{
	/**
	 * 验证规则
	 * @var [type]
	 */
	protected $rule = [
		'addressId|地址id' => 'require|number',
		'couponId|优惠券id' => 'require|number',
		'postscript|留言' => 'require',
		'orderId|订单id' => 'require'
	];

	/**
	 * 提交订单验证场景
	 * @Author   fanzhongxing
	 * @DateTime 2020-05-26T22:45:10+0800
	 * @return   [type]                   [description]
	 */
	public function sceneSubmit()
	{
		return $this->only(['addressId', 'couponId']);
	}

	/**
	 * 订单详情验证场景
	 * @Author   fanzhongxing
	 * @DateTime 2020-05-28T22:09:23+0800
	 * @return   [type]                   [description]
	 */
	public function sceneDetail()
	{
		return $this->only(['orderId']);
	}
}